home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / mpss / dock.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-07-20  |  2.3 KB  |  85 lines

  1.  
  2. /*******************************************************************************
  3. ********************************************************************************
  4. ********************************************************************************
  5.  
  6. PERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
  7. THIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
  8.  
  9.         P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
  10.  
  11.  
  12. ********************************************************************************
  13. ********************************************************************************
  14. *******************************************************************************/
  15.  
  16. #include "header.h"
  17.  
  18. dock(cp)
  19. register struct player *cp;
  20. {
  21. int dockingok;
  22.  
  23. dockingok=OFF;
  24. i=cp->xpos;
  25. j=cp->ypos;
  26. if ((inuniv(i,j)=='*') && ((cp->xvel==0) && (cp->yvel==0)))
  27.         dockingok=ON;
  28. if (dockingok==OFF)
  29.     {
  30.     plot1(cp,"   Your'e not beside a federation starbase Captain.      ");
  31.     plot2(cp,"                                                         ");
  32.     } else
  33.     {
  34.     if ((cp->cloakingdevice)||(cp->shields))
  35.         {
  36.         if (cp->shields)
  37.         {
  38.     plot1(cp,"                                                         ");
  39.     plot2(cp,"   While you have your shields are up? Youre kidding!    ");
  40.         }
  41.         else
  42.         {
  43.     plot1(cp,"                                                         ");
  44.     plot2(cp,"          While you are cloaked? -come off it!           ");
  45.         } 
  46.     } else
  47.         {
  48.         plot1(cp,"               Docking procedure completed.              ");
  49.         plot2(cp,"         Weapons and Crystal Units recharged Captain.    ");
  50.         plotstatus(cp,7);
  51.  
  52.         if (cp->maxenergy>=STARTENERGY)
  53.             cp->energy=cp->maxenergy;
  54.             else
  55.             {
  56.             cp->energy=STARTENERGY;
  57.             cp->maxenergy=STARTENERGY;
  58.             }
  59.         cp->phaserbanks=cp->maxphaser;
  60.         cp->photontorpedos=cp->maxphoton;
  61.         plotenergy(cp);
  62.         plotmaxenergy(cp);
  63.         plotphaserbanks(cp);
  64.         plotphotontorpedos(cp);
  65.         }
  66.     }
  67. }
  68.  
  69. undock(cp)
  70. register struct player *cp;
  71. {
  72. if ((cp->stat==7) && (cp->xvel==0) && (cp->yvel==0)) 
  73. {
  74. plot1(cp," Un-docking successful Captain. No casualties this time. ");
  75. plot2(cp,"                   Your'e improving...                   ");
  76. plotstatus(cp,3);
  77. } else
  78. {
  79. plot1(cp,"Tell me :- How can you un-dock when your'e not docked??? ");
  80. plot2(cp,"                                                         ");
  81. }
  82. }
  83.  
  84.  
  85.